using System;
using System.Collections.Generic;
using System.Text;

namespace Bludz
{
    /// <summary>
    /// Implements the singleton design pattern. NOT threadsafe.
    /// </summary>
    /// <typeparam name="T">The type of the class to use.</typeparam>
    class Singleton<T> where T : new()
    {
        static T instance;

        static public T get()
        {
            if (instance == null)
                instance = new T();
            return (T)instance;
        }

        public virtual void log(string s)
        {
            LogServer.get().log(typeof(T).Name, s);
        }
    }
}
